#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int main()
{
	int n;
	scanf("%d", &n);

	if (n <= 0)
	{
		printf("-1\n");
		return 0;
	}

	int sum2 = 0;
	int sum1 = 1;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= i; j++)
		{
			sum1 *= j;
		}
		sum2 += sum1;
		sum1 = 1;
	}

	printf("%d\n", sum2);
	return 0;
}